import { GET_UER, LOGOUT } from '../constants'

export default function user(state = {}, action) {
  //退出
  if (action.type === LOGOUT) {
    return {
      ...state,
      token: '',
    }
  }
  //获取用户信息
  if (action.type === GET_UER) {
    return action.payLoad
  }
  return state
}
